﻿<!--/************************************************************************************  
' Copyright (C) 2009 Anthony Bouch (http://www.58bits.com) under the terms of the
' Microsoft Public License (Ms-PL http://www.codeplex.com/precode/license)
'***********************************************************************************/-->
    <Window x:Class="FiftyEightBits.PreCode.PreCodeWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FiftyEightBits.PreCode"
    Title="PreCode Code Window" 
    Height="550" 
    Width="675" 
    Icon="Icons/PreCode48.ico"
    WindowStartupLocation="CenterScreen"
    ShowInTaskbar="True" 
    Background="Transparent"
    MinHeight="550" 
    MinWidth="675" 
    ResizeMode="CanResizeWithGrip" 
    WindowStyle="None" 
    AllowsTransparency="True"
    Margin="0"
    Padding="0"> 
   <Window.Resources>
        <!-- Note: The styles and themes are loaded into each form instead of an App.Xaml - because
        the project is also combiled as a class library for the WLW plugin. There's probably a better way to share
        resources. -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/Black.xaml" />                
                <ResourceDictionary Source="Styles/BuilderStyles.xaml" />
                <ResourceDictionary Source="Styles/LibraryStyles.xaml" />
                <ResourceDictionary Source="Styles/ExpanderStyle.xaml" />
                <ResourceDictionary Source="Styles/ToolBarButtons.xaml"/>
                <ResourceDictionary Source="Styles/ScrollViewer.xaml"/>
                <ResourceDictionary Source="Styles/TextBoxBase.xaml"/>
                <ResourceDictionary Source="Styles/CheckBoxStyle.xaml"/>
                <ResourceDictionary Source="Styles/ComboBoxStyle.xaml"/>
                <ResourceDictionary Source="Styles/CloseButton.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Border CornerRadius="5" Background="Black" BorderBrush="#777" BorderThickness="1" Margin="0" Padding="0">
        <Border CornerRadius="5" Background="Black" BorderBrush="#000" BorderThickness="1" Margin="0" Padding="0">
            <Grid Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <!--Title Bar-->
                <Border Margin="0" Padding="0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Height="25"  BorderBrush="#FF333333" BorderThickness="0">
                    <Border.Background>
                       <RadialGradientBrush Center="0.5,0.2" GradientOrigin="0.5,-0.2" RadiusX="0.5" RadiusY="0.5">
                            <GradientStop Color="#FFFFFFFF"  Offset="0"/>
                            <GradientStop Color="#55111111" Offset="1"/>
                        </RadialGradientBrush>
                    </Border.Background>
                    <StatusBar x:Name="TitleBar" Padding="0" Margin="0" BorderBrush="#FF999999" BorderThickness="0">
                        <StatusBar.Background>
                            <LinearGradientBrush StartPoint="0.486,0" EndPoint="0.486,0.986">
                                <GradientStop Color="#33666666" Offset="0"/>
                                <GradientStop Color="#77666666" Offset="0.4"/>
                                <GradientStop Color="#77666666" Offset="0.5"/>
                                <GradientStop Color="#22666666" Offset="1"/>
                            </LinearGradientBrush>
                        </StatusBar.Background>
                        <StatusBarItem Margin="2,0" Padding="0">
                            <local:IconControl />
                        </StatusBarItem>
                        <StatusBarItem Margin="5,0,0,0" Padding="0">
                            <TextBlock>PreCode Code Snippet Manager</TextBlock>
                        </StatusBarItem>
                        <StatusBarItem HorizontalAlignment="Right" Margin="0,2,5,2" Padding="0">
                            <local:CloseButton IsCancel="True"  IsDefault="True" />
                        </StatusBarItem>
                    </StatusBar>
                </Border>

                <!--Toolbar -->
                <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="1,0,3,0" BorderBrush="#666" CornerRadius="1" BorderThickness="1">
                    <Border.Background>
                        <RadialGradientBrush Center="0.5,0.2" GradientOrigin="0.5,-0.2" RadiusX="0.5" RadiusY="0.5">
                            <GradientStop Color="#FFFFFFFF"  Offset="0"/>
                            <GradientStop Color="#55111111" Offset="1"/>
                        </RadialGradientBrush>
                    </Border.Background>
                    <StatusBar x:Name="MainToolBar" Padding="0" Margin="0" BorderBrush="#555" BorderThickness="0">
                        <StatusBar.Background>
                            <LinearGradientBrush StartPoint="0.486,0" EndPoint="0.486,0.986">
                                <GradientStop Color="#33666666" Offset="0"/>
                                <GradientStop Color="#33666666" Offset="0.4"/>
                                <GradientStop Color="#BB222222" Offset="0.5"/>
                                <GradientStop Color="#BB111111" Offset="1"/>
                            </LinearGradientBrush>                           
                        </StatusBar.Background>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <local:ToolBarButton x:Name="Button_DeDent" Padding="1,4" Click="Button_DeDent_Click">&lt;&lt;</local:ToolBarButton>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <local:ToolBarButton x:Name="Button_InDent" Padding="1,4" Click="Button_InDent_Click">&gt;&gt;</local:ToolBarButton>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <local:ToolBarButton x:Name="Button_FixIndentation" Padding="10,4" Click="Button_FixIndentation_Click">Fix Indentation</local:ToolBarButton>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <StackPanel Orientation="Horizontal">
                                <Line Margin="4,0,0,0" SnapsToDevicePixels="False" Stroke="#55000000" Stretch="Fill" X1="0" Y1="0" X2="0" Y2="16" />
                                <Line Margin="0,0,4,0" SnapsToDevicePixels="False" Stroke="#FF999999" Stretch="Fill" X1="0.5" Y1="0" X2="0.5" Y2="16" />
                            </StackPanel>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <local:ToolBarButton x:Name="Button_CheckForUpdate" Padding="10,4" Click="Button_CheckForUpdate_Click">Check For Update</local:ToolBarButton>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <local:ToolBarButton x:Name="Button_About" Padding="10,4" Click="Button_About_Click">About...</local:ToolBarButton>
                        </StatusBarItem>
                        <StatusBarItem Margin="1,1" Padding="0">
                            <StackPanel Orientation="Horizontal">
                                <Line Margin="4,0,0,0" SnapsToDevicePixels="False" Stroke="#55000000" Stretch="Fill" X1="0" Y1="0" X2="0" Y2="16" />
                                <Line Margin="0,0,4,0" SnapsToDevicePixels="False" Stroke="#FF999999" Stretch="Fill" X1="0.5" Y1="0" X2="0.5" Y2="16" />
                            </StackPanel>
                        </StatusBarItem>
                        <StatusBarItem HorizontalAlignment="Right" Margin="1,1" Padding="0">
                            <StackPanel Orientation="Horizontal" Margin="0" >
                                <local:ToolBarButton x:Name="Button_Ok" Padding="20,4" Click="Button_Ok_Click">Ok</local:ToolBarButton>
                                <local:ToolBarButton x:Name="Button_Cancel" Padding="10,4" Click="Button_Cancel_Click">Cancel</local:ToolBarButton>
                            </StackPanel>
                        </StatusBarItem>
                    </StatusBar>
                </Border>
                
                <!--Text Area -->
                <TextBox Background="#f4f3e3" PreviewKeyDown="TextBox_Code_PreviewKeyDown"  Grid.Column="0" Grid.Row="2" TextWrapping="NoWrap" FontFamily="Courier New" Margin="0,2,1,0" Name="TextBox_Code" VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" />

                <!--Options Panel-->
                <Grid Grid.Row="2" Grid.Column="1">
                    <Grid.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#DD222222" Offset="0"/>
                            <GradientStop Color="#DD222222" Offset="0.3"/>
                            <GradientStop Color="#BB222222" Offset="0.6"/>
                            <GradientStop Color="#BB000000" Offset="1"/>
                        </LinearGradientBrush>
                        <!--<LinearGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" StartPoint="0,0" EndPoint="0,1">
                          <GradientStop Color="sc#0.86 0.13 0.13 0.13" Offset="0" />
                          <GradientStop Color="sc#0.86 0.13 0.13 0.13" Offset="0.3"/>
                          <GradientStop Color="sc#0.73 0.13 0.13 0.13" Offset="0.6"/>
                          <GradientStop Color="sc#0.73 0.0 0.0 0.0" Offset="1.0" />
                        </LinearGradientBrush>-->
                    </Grid.Background>
                    
                    <StackPanel x:Name="StackPanel_Options" Margin="3">
                        <Expander Header="Format" x:Name="Expander_FormatOptions" IsExpanded="True">
                            <StackPanel HorizontalAlignment="Stretch" x:Name="StackPanel_FormatOptions"  Visibility="Visible" Background="Transparent" Margin="0,0,0,5" >
                                <Label HorizontalContentAlignment="Left">Surround With:</Label>
                                <ComboBox x:Name="ComboBox_SurroundWith" Width="140" Margin="0,0,0,7" Background="Black" Foreground="{DynamicResource FontForecolor}" HorizontalAlignment="Center"  SelectionChanged="ComboBox_SurroundWith_SelectionChanged">
                                    <ComboBoxItem Name="None" Content="None"></ComboBoxItem>
                                    <ComboBoxItem Name="Pre" Content="PRE"></ComboBoxItem>
                                    <ComboBoxItem Name="TextArea" Content="TEXTAREA"></ComboBoxItem>
                                </ComboBox>
                                <CheckBox x:Name="CheckBox_HtmlEncode" Margin="0,0,0,7" HorizontalAlignment="Left">Html Encode</CheckBox>
                                <CheckBox x:Name="CheckBox_LineEndings" Margin="0,0,0,7" HorizontalAlignment="Left">Swap CRLFs with &lt;BR&gt;s </CheckBox>
                            </StackPanel>
                        </Expander>
                        <Expander Header="Syntax Highlighting" x:Name="Expander_SyntaxOptions" IsExpanded="True">
                            <StackPanel HorizontalAlignment="Stretch" x:Name="StackPanel_SyntaxOptions"  Visibility="Visible" Background="Transparent" >
                                <Label>Highlighter Class:</Label>
                                <ComboBox x:Name="ComboBox_HighLighterClass" Width="140"  Margin="0,0,0,9"  Background="Black" HorizontalAlignment="Center"></ComboBox>
                                <CheckBox x:Name="CheckBox_DoNotShowToolBar" Margin="0,0,0,8" HorizontalAlignment="Left">Do Not Show Toolbar</CheckBox>
                                <CheckBox x:Name="CheckBox_DoNotShowGutter" Margin="0,0,0,8" HorizontalAlignment="Left">Do Not Show Gutter</CheckBox>
                                <CheckBox x:Name="CheckBox_CollapseBlock" Margin="0,0,0,8" HorizontalAlignment="Left">Collapse Block</CheckBox>
                                <CheckBox x:Name="CheckBox_DisableAutoLinks" Margin="0,0,0,8" HorizontalAlignment="Left">Disable Auto-Links</CheckBox>
                                <CheckBox x:Name="CheckBox_ShowRuler" Margin="0,0,0,8" HorizontalAlignment="Left">Show Ruler</CheckBox>
                                <CheckBox x:Name="CheckBox_TurnOffSmartTabs" Margin="0,0,0,8" HorizontalAlignment="Left">Turn Off Smart Tabs</CheckBox>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                    <Label Content="Start Line Count At:"/>
                                    <local:NumberBox Style="{StaticResource BuilderTextBox}" MinWidth="20" x:Name="TextBox_LineCountStart" Background="#00000000" Margin="0" Padding="0" BorderBrush="#FF393939" Height="20" Min="1" Max="9999" Text="1" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                    <Label Content="Highlight Lines (csv):"/>
                                    <TextBox Style="{StaticResource BuilderTextBox}" MinWidth="20" x:Name="TextBox_HighLightLines" Background="#00000000" Margin="0" Padding="0" BorderBrush="#FF393939" Height="20" />
                                </StackPanel>
                            </StackPanel>
                        </Expander>
                    </StackPanel>
                </Grid>
                <StatusBar x:Name="StatusBar_Bottom" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Padding="0" BorderBrush="#FFEEEEEE" BorderThickness="0,1,0,0" Margin="1,0,1,1"  Height="19" VerticalAlignment="Bottom" >
                    <StatusBarItem HorizontalAlignment="Right" Margin="0" Padding="0">
                        <ResizeGrip HorizontalAlignment="Right" Style="{StaticResource VisibleResizeGrip}"> </ResizeGrip>
                    </StatusBarItem>
                </StatusBar>
            </Grid>
        </Border>
    </Border>
</Window>
